﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AISFMIOperator
{
    public partial class FacilityListForm : Form
    {
        public FacilityListForm()
        {
            InitializeComponent();
            RefreshFacilityTable();
        }

        private void RefreshFacilityTable()
        {
            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.DataSource = Facility.GetAllFacilities();
            dataGridView1.Columns[0].DataPropertyName = "FacilityID";
            dataGridView1.Columns[1].DataPropertyName = "FacilityName";
            dataGridView1.Columns[2].DataPropertyName = "FacilityTypeName";
            dataGridView1.Columns[3].DataPropertyName = "FullAddress";
        }

        private void FacilityListForm_Load(object sender, EventArgs e)
        {

        }

        private void button6_Click(object sender, EventArgs e)
        {
            AddFacilityForm af = new AddFacilityForm();
            af.ShowDialog();
            RefreshFacilityTable();
        }
    }
}
